import request from '@/utils/request'

export function getCourse() {
  return request({
    url: '/course',
    method: 'get'
  })
}

export function createCourse(course) {
  return request({
    url: '/course/create',
    method: 'post',
    data: course
  })
}

export function updateCourse(course) {
  return request({
    url: '/course/update',
    method: 'post',
    data: course
  })
}

export function UploadImage(data) {
  return request({
    url: '/course/imgUpload',
    method: 'post',
    data: data
  })
}

export function deleteCourse(fileName) {
  return request({
    url: '/course/delete',
    method: 'get',
    params: { fileName }
  })
}
